import axios from 'axios';

axios.defaults.baseURL = 'http://localhost:3001';

axios.interceptors.request.use(function (config) {
	if (window.sessionStorage.getItem('token')) {
		config.headers.Authorization = window.sessionStorage.getItem('token');
	}
	return config;
}, function (err) {
	console.log(err);
})

axios.interceptors.response.use(function (res) {
	return res.data;
}, function (err) {
	return err;
})